#ifndef ROBOTCMDNODE_ROBOTARM_H_
#define ROBOTCMDNODE_ROBOTARM_H_

/*****************************************************************************
** Includes
*****************************************************************************/
//ROS2
#include "rclcpp/rclcpp.hpp"
#include "pccmd_msg/msg/pc_cmd.hpp"
#include "jsonba_msg/msg/json_ba.hpp"
//CPP
#include <chrono>
#include <memory>
#include <functional>
#include <string>

class RobotArm;
/*****************************************************************************
  ** Class
  *****************************************************************************/

class RobotCmdNode : public rclcpp::Node
{
public:
    RobotCmdNode(RobotArm *ra);
    virtual ~RobotCmdNode();

    void pubJsonBa(const std::string& name, unsigned int size);

private:
    void pcCmdMsgCB(const pccmd_msg::msg::PcCmd::SharedPtr msg) const;

    rclcpp::Subscription<pccmd_msg::msg::PcCmd>::SharedPtr subscription_;
    rclcpp::Publisher<jsonba_msg::msg::JsonBa>::SharedPtr m_pubJsonBa;


    void getParameters();

private:
    RobotArm *m_ra;
    std::string m_strName;
    std::string m_strIp;
    unsigned short m_usPort;
};

#endif //ROBOTCMDNODE_ROBOTARM_H_
